import service from '@/utils/request'

export const useDriverApi = (id: number) => {
  return service.get('/biz/driver/' + id)
}

export const useDriverSubmitApi = (dataForm: any) => {
  if (dataForm.id) {
    return service.put('/biz/driver', dataForm)
  } else {
    return service.post('/biz/driver', dataForm)
  }
}

export const useDriverListApi = (data: any = undefined) => {
  return service.get('/biz/driver/list', {
    params: data
  })
}
// export const getdriverInfoApi = (imei: any = undefined) => {
//   return service.get('/biz/driver/',imei)
// }
export function useSearchNameApi(key: string) {
  return service.get('/biz/driver/page', {
    params: {
      key,
      page: 1,
      limit: 100
    }
  })
}
